home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
prog_d
/
oleauttr.zip
/
README.1ST
< prev
next >
Wrap
Text File
|
1996-01-12
|
7KB
|
135 lines
README.1ST file for TOleAutoClient V1.1
*** TRIAL-RUN VERSION ***
*** THIS TRIAL-RUN COMPONENT IS DESIGNED TO FUNCTION ONLY WHEN
*** THE DELPHI IDE ITSELF IS RUNNING. APPLICATIONS COMPILED
*** WITH THE TRIAL-RUN VERSION WILL NOT FUNCTION CORRECTLY
*** UNLESS DELPHI IS RUNNING.
*** THIS TRIAL-RUN VERSION IS LICENSED FOR EVALUATION PURPOSES
*** ONLY. YOU MAY NOT DISTRIBUTE APPLICATIONS COMPILED WITH
*** IT. FOR ANY PURPOSE OTHER THAN EVALUATION TO DETERMINE
*** SUITABILITY FOR USE, YOU MUST PURCHASE THE COMMERCIAL VERSION.
*** SEE THE FILE ANNOUNCE.TXT OR ORDER.TXT FOR AN ORDER FORM.
*** THIS TRIAL-RUN VERSION IS ACCOMPANIED BY ALL DOCUMENTATION
*** AND SAMPLE CODE INCLUDED WITH THE COMMERCIAL VERSION.
*** NO SUPPORT WHATSOEVER WILL BE PROVIDED FOR THIS TRIAL-RUN VERSION.
*** SEE THE FILE LICENSE.TXT FOR THE TERMS UNDER WHICH THIS
*** SOFTWARE AND ITS ACCOMPANYING DOCUMENTATION AND FILES MAY BE USED.
*** IT IS NOT POSSIBLE TO HAVE BOTH THIS TRIAL-RUN VERSION
*** AND THE COMMERCIAL VERSION OF THE COMPONENT INSTALLED
*** ON YOUR DELPHI COMPONENT PALETTE AT THE SAME TIME.
Installing the TOleAutoClient component:
0. FIRST MAKE A BACKUP COPY OF THE COMPLIB.DCL FILE
LOCATED IN YOUR DELPHI\BIN DIRECTORY!!!
1. Copy the files OLEAUTO.DCU and OLEAUTO.DCR to your
DELPHI\LIB directory (for example, C:\DELPHI\LIB).
If you are upgrading from an earlier version of
this component, you may wish to back up these files
before performing this step.
2. Make new directories for each of the zipped example files
and use PKUNZIP to uncompress these .ZIP files. (PKUNZIP
is a widely-available shareware program.) You will
find that each of the example files contains useful
sample code to help you make the most effective use
of the component
3. Within Delphi, click on Options\Install Components and
fill in the dialog to Add the component (filename OLEAUTO.DCU).
If you are upgrading, before you click the Add button you
should first select OLEAUTO and then click the Remove
button to remove the previous version from your component
palette and COMPLIB.DCL file.
4. The TOleAutoClient component should appear on the Custom
page of your Component Palette.
You should read all the .TXT and .DOC files on this diskette
to make the most effective use of this Delphi component. But
for those who simply can't wait, here's something to help you
get started!
Before using the component:
1. Be sure that the OLE Automation server you plan to control
(e.g., Microsoft Word, or NUMSVR1.EXE supplied here) is present
on your hard disk, and be sure that you have run it at least once
as a standalone application (e.g., from Program Manager's
File|Run menu). This is so it can register itself in your
system's Windows OLE registration database (\WINDOWS\REG.DAT)
or, if you're running Windows 95, in the Registry.
Using the component:
1. First, create a new unit and within the unit
derive a class from the TOleObject parent class (*NOT*
from TOleAutoClient) that "mirrors" the behaviour
(properties and methods) of the OLE object you want to
create. For guidance in writing the "mirror" class,
refer to the examples given in the WORDCLS.PAS file within
WORDDRIV.ZIP and in the unit files in the other examples.
You can find more detailed information on the public interface
to the TOLEObject and TAutoClient classes defined in
OLEAUTO.DCU in the accompanying files OLEAUTO.INT and
OLEAUTO.TXT and NESTOBJ.TXT.
Add the name of this new unit to the "uses" clause of any unit
you want to be able to access the OLE Automation server.
If you will be writing many mirror classes, you may wish
to investigate a shareware product called WithClass,
available through CompuServe and the Internet World Wide Web,
that can help you automate the process.
2. Place a TOleAutoClient component on your application's
main form just as you would any other Delphi component, like
a TLabel, TEdit, etc. NOTE: Failing to do this will result
in the inability to start up OLE Automation servers if you
are running under Windows 3.x, although you can get away with
it under Windows 95!
3. Within your application, typically in the interface section of
the unit corresponding to your application's main form, declare
a variable representing an instance of the "mirror" class you
created in step 1. Make sure the scope of this variable is
appropriate for your intended use (e.g., global, public, etc.).
For example, you might declare this variable as a public
member of the TForm1 class as
public
WordOb : TWordObject;
if TWordObject is your class derived from TOleObject.
4. Within your application, create an OLE object (that is, activate
the OLE Automation server) with the statement
WordOb := TWordObject.CreateObject('word.basic');
in which the string passed to CreateObject must be the
OLE ProgID (program ID) string registered for the OLE object in
your systems registration database. For Microsoft Word 6.0 this
string is 'word.basic'; for Excel it is 'Excel.Application'.
For other OLE Automation servers, consult the server documentation
or browse your system's registration database or Registry by
running "REGEDIT /v" from Program Manager's File|Run menu.
The string is not case-sensitive.
The TOleAutoClient component can activate and control either
"local" (.EXE) OLE Automation servers or "in-process" (.DLL)
servers. Under Windows 95, you can activate and control either
16-bit or 32-bit local (.EXE) servers. However, you will not
be able to activate a 32-bit in-process (.DLL) server from
your 16-bit Delphi application. This is a limitation of
Windows 95.
5. You access the properties and methods of the OLE object by
accessing the properties and methods of your "mirror" class.
See the examples supplied. Also refer to the file OLEAUTO.TXT
supplied with this component.